def writeFile(filePath, content):
    print('Write info to file:Start...')
    # 将文件内容写到文件中
    with open(filePath, 'a', encoding='utf-8') as f:
        f.write(content)
        print('Write info to file:end...')

def readFile(filepath):
    f=open(filepath,'r',encoding='UTF8')
    return f.read()

def isChinese(ch):
    return '\u4e00' <= ch <= '\u9fff'

content=readFile('D:/魔女鸣泣之时剧本.txt')
content=content.replace(r'\n','\n')
content=content.split('\n')

for i in range(len(content)):
    str=content[i]
    for j in range(len(str)):
        if isChinese(str[j]):
            break
    start=j
    content[i] = str[start:]
    '''
    end=-1
    for j in range(start,len(str)):
        if str[j].isdigit() and end==-1:
            end=j
        elif str[j]=='\\':
            break
    content[i]=str[start:end]
    '''
result=''
for i in content:
    result+=i+'\n'
print(result)
writeFile('D:/魔女鸣泣之时.txt',result)